home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: f;oating point precision
- Date: 7 Mar 1996 16:32:21 GMT
- Organization: OpenVision
- Message-ID: <4hn32l$rvt@spanky.pls.ov.com>
- References: <c0d_9603050128@csource.blaze.net.au>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article 9603050128@csource.blaze.net.au, David.Burrows@f158.n633.z3.fidonet.org (David Burrows) writes:
- >Help.... I am getting floating point innaccuracies at about the 4th decimal
- >
- >place. eg i enter 510.0250 and it comes out as 510.0249.
- >I am just starting to learn c so please excuse my ignorance.
- > dave
- >
- >--
- >David.Burrows@f158.n633.z3.fidonet.org, David Burrows 3:633/158 (FidoNet)
- >
-
- Your machine uses binary to represent numbers and to perform calculations.
- There are many decimal fractions that cannot be represented exactly in
- binary because they require non-terminating binary fractions. The machine
- will use the nearest possible binary approximation for your floating
- point calculations. The limit of the approximation is determined by the
- word size of the mantissa. You can increase accuracy using a double instead
- of a float.
-
- Fletcher.Glenn@ov.com
-
-
-